package CreationModel.PrototypeModel.DeepAndShallowClone.DeepCloneTwo;


import java.io.IOException;

/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-12-06 18:05:00
 */
public class SwallowClient {

    public static void main(String[] args) throws CloneNotSupportedException, ClassNotFoundException, IOException {

        Swallow s1 = new Swallow("大雁a", new Wing(10), new Wing(10));
        Swallow s2 = (Swallow) s1.deepClone();

        System.out.println("(s1==s2)="+ (s1==s2));
        System.out.println("s1.name="+ s1.getName()+", s2.name="+s2.getName());
        System.out.println("(s1.leftWing==s2.leftWing) = "+(s1.getLeftWing()==s2.getLeftWing()));
        System.out.println("(s1.rightWing==s2.rightWing) = "+(s1.getRightWing()==s2.getRightWing()));
    }
}
